private void handleRetr(String[] tokens) throws IOException {
        if (!authenticated) {
        out.println("530 Not logged in");
        return;
        }

        if (tokens.length < 2) {
        out.println("501 Syntax error in parameters or arguments");
        return;
        }

        String filename = tokens[1];
        File file = new File(filename);

        if (!file.exists()) {
        out.println("550 File not found");
        return;
        }

        out.println("150 Opening data connection");

        // 建立数据连接(简化版，实际FTP协议中需要PORT或PASV命令)
        try (Socket dataSocket = new Socket(controlSocket.getInetAddress(), 20);
        FileInputStream fis = new FileInputStream(file);
        OutputStream os = dataSocket.getOutputStream()) {

        byte[] buffer = new byte[4096];
        int bytesRead;

        while ((bytesRead = fis.read(buffer)) != -1) {
        os.write(buffer, 0, bytesRead);
        }

        out.println("226 Transfer complete");
        } catch (IOException e) {
        out.println("425 Can't open data connection");
        }
        }